﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections.Generic;
using Runda.CMS.Common.Utility;
using Runda.CMS.Common.Entity;
using Runda.CMS.Bll;

namespace Runda.CMS.Portal.Workspace
{
    public partial class DESK_MessageBoard : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack) {
                String currentUserID =  Session["CurrentUserID"].ToString();
                if (currentUserID != String.Empty)
                {
                    CtrtMyNoticeBll bll = new CtrtMyNoticeBll();
                    List<CtrtMyNoticeEntity> entitys = new List<CtrtMyNoticeEntity>();
                    string sql = "select Top 6 a.NoticeID, NoticeContent,a.Noticetime,b.UserName from Cms_Ctrt_MyNotice a inner join cms_sys_user b with(nolock) on a.createdBy = b.userid where NoticeTime <'" + System.DateTime.Now.ToString() + "'and NoticeType =" + System.Convert.ToInt32(Enumerator.NoticeMessageType.Private) + " and NoticeID in ( select NoticeID from Cms_Ctrt_MyNoticeUser where Status = " + System.Convert.ToInt32(Enumerator.NoticeMessageStatus.unread) + " and UserID = '" + currentUserID + "') order by NoticeTime desc";

                    this.Repeater1.BindMode = 0;
                    this.Repeater1.SQL = sql;
                    this.Repeater1.DataBind();
                }
            }
        }
    }
}
